import java.util.Arrays;
import java.util.Random;

public class Test {

    public static void main(String[] args) {
        int []arr={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr));
        Sort sort=new Sort();
        sort.nonRecursiveMergeSort(arr);
        System.out.println(Arrays.toString(arr));

    }

    public static void main3(String[] args) {
        int []arr={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr));
        Sort sort=new Sort();
        sort.quickSort1(arr);
        System.out.println(Arrays.toString(arr));

    }

    public static void main2(String[] args) {
        int []arr={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr));
        Sort sort=new Sort();
        sort.InsertSort1(arr);
        System.out.println(Arrays.toString(arr));

    }

    public static void main1(String[] args) {
        int []arr={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr));
        Sort sort=new Sort();
        sort.InsertSort(arr);
        System.out.println(Arrays.toString(arr));

        int []arr2={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr2));
        sort.ShellSort(arr2);
        System.out.println(Arrays.toString(arr2));

        int []arr3={4,5,2,1,4,2,3,22,11,2};
        System.out.println(Arrays.toString(arr3));
        sort.selectSort(arr3);
        System.out.println(Arrays.toString(arr3));
//        int []arr3=new int[100];
//        createRandomArray(arr3,1000);
//        System.out.println(Arrays.toString(arr3));
//        sort.ShellSort(arr3);
//        System.out.println(Arrays.toString(arr3));
    }

    public static void createRandomArray(int []arr){
        Random random=new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i]=random.nextInt(100000);
        }
    }

    public static void createRandomArray(int []arr,int size){
        Random random=new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i]=random.nextInt(size);
        }
    }

}
